<template>
  <div>
    <button @click="addB">+1==add</button>
    ==={{$store.state.count}}==={{count}}
  </div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
export default {
  data () {
    return {
      num: 3
    }
  },
  computed: {
    ...mapState(['count'])
  },
  methods: {
    addA () {
      this.addMain(2)
    },
    addB () {
      this.$store.dispatch('a1', this.num)
    },
    ...mapMutations(['addMain'])
  }
}
</script>
<style scoped>
</style>
